<?php include '../admin_head.php';
//获取分类信息
$sql = "select id,name,path,concat(path,id) bpath from ".PRE."category order by bpath";
	$result = mysql_query($sql);
	if($result && mysql_num_rows($result)>0){
		while($row = mysql_fetch_assoc($result)){
			$row['name'] = str_repeat('&nbsp;&nbsp;',(strlen($row['path'])-2)/2).$row['name'];
			$catelist[] = $row;
		}
	}
?>
	
		<div class="admin_main_nav">商品管理&gt;&gt;添加商品</div>
		<div id="admin_addcate" class="admin_form admin_main_index">
			<table width="500">
			<div class="user_index_title"></div>
			<form action="action.php?a=add" method="post" enctype="multipart/form-data">
				<tr>
					<th>所属分类：</th>
					<td>
						<select name="pid">
							<option value="0">顶级分类</option>
							<?php foreach($catelist as $tr):?>
							<option value="<?php echo $tr['id'] ?>" <?php echo $pid == $tr['id'] ? 'selected': '' ; ?>><?php echo $tr['name'] ?></option>
							<?php endforeach;?>
						</select>
					</td>
				</tr>
				<tr>
					<th>商品名称：</th>
					<td><input type="text" name="name" /></td>
				</tr>
				<tr>
					<th>商品价格：</th>
					<td><input type="text" name="price" /></td>
				</tr>
				<tr>
					<th>商品数量：</th>
					<td><input type="text" name="store" /></td>
				</tr>
				<tr>
					<th>商品状态：</th>
					<td class="radio">
						<input type="checkbox" name="status[]"  value="1"/><span>热销</span>
						<input type="checkbox" name="status[]" value="2"/><span>新品</span>
						<input type="checkbox" name="status[]" value="4"/><span>精品</span>
					</td>
				</tr>
				<tr>
					<th>商品风格：</th>
					<td>
						<select name="style">
							<option value="0">普通风格</option>
							<option value="1">时尚内衣</option>
							<option value="2">优雅女装</option>
							<option value="3">休闲女装</option>
							<option value="4">日韩女装</option>
							<option value="5">欧式女装</option>
							<option value="6">意式女装</option>
							<option value="7">年轻潮牌</option>
							<option value="8">高端男装</option>
						</select>
					</td>
				</tr>
				<tr>
					<th>售卖状态：</th>
					<td class="radio">
						<input type="radio" name="is_up" value="1" /><span>上架</span>
						<input type="radio" name="is_up" value="0" checked/><span>仓库</span>
					</td>
				</tr>
				<tr>
					<th>商品图片：</th>
					<td><input type="file" name="pic" /></td>
				</tr>
				<tr>
					<th>商品描述：</th>
					<td><textarea name="describe" cols="30"></textarea></td>
				</tr>
				<tr>
					<td colspan="2" class="submit"><input type="submit" value="添加商品" /></td>
				</tr>
			</form>
			</table>
		</div>

		
<?php include '../admin_footer.php';?>
